﻿@page "/file-upload"
@layout EmptyLayout
@using System.Linq
@using System.Net.Http.Headers
@using System.Net

<PageTitle>File Upload 2</PageTitle>

<Upload Action="https://www.mocky.io/v2/5cc8019d300000980a055e76"
Name="Video"
Accept=".img"
Drag
ShowButton="true"
OnSingleCompleted="OnSingleCompleted">
    <p class="ant-upload-drag-icon">
        <Icon Type="@IconType.Outline.Inbox" />
    </p>
    <p class="ant-upload-text">Click or drag file to this area to upload</p>
    <p class="ant-upload-hint">
        Support for a single or bulk upload. Strictly prohibit from uploading company data or other
        band files
    </p>
</Upload>


@code{
    
    // Ant Design File
    private UploadFileItem _file = new();
    void OnSingleCompleted(UploadInfo fileinfo)
    {

    }

    // InputFile for streaming
    //InputFile Razor
    private async Task OnInputFileChange(InputFileChangeEventArgs e)
    {
        var request = new HttpRequestMessage(HttpMethod.Post, "/Filesave");
        //request.SetBrowserRequestStreamingEnabled(true); request.Content = content;
        //var response = await Http.SendAsync(request);
    }
    public class ResponseModel
    {
        public string name { get; set; }

        public string status { get; set; }

        public string url { get; set; }

        public string thumbUrl { get; set; }
    }
}